package com.fhz.kotlinmvvm.broadcast

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.fhz.kotlinmvvm.con.BROADCAST_ACTION
import com.fhz.kotlinmvvm.con.BROADCAST_ACTION_FENG

class MyReceiver2 : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        val action = intent.action
        if (action.equals(BROADCAST_ACTION)){
            val bundle = intent.extras
            val string = bundle?.getString("title")
            println(123)
            println(string)
        }

        //TODO 一会从这开始

        /**
         *
         * 1,动态广播测试
         * 2,拦截测试
         * 3,
         *
         *
         *
         */





        //是否有序
        if(isOrderedBroadcast) {
            //不在继续,终端了.
//            abortBroadcast()
        }
    }
}